GCC = g++
CPPFLAGS = -g -finline-functions -Wall -Winline -pipe -DOS_LINUX
HEAD_INFO = -DPROJECT_NAME="\"FASTSEARCH\"" -DDESCRIPTION="\"FastSearch indexer\""
COMMON_PATH=../../common
	  
INCLUDES = -I./ -I$(COMMON_PATH)/commonlib/output/include \
	       -I$(COMMON_PATH)/termindex \
	       -I$(COMMON_PATH)/sign/ 

LIBS     = -L./ -L$(COMMON_PATH)/commonlib/output/lib -lcommonlib \
	       -L$(COMMON_PATH)/sign/ -lsign \
	       -lpthread

all : libindex_reader.a
	  mkdir -p output/include
	  mkdir -p output/lib 
	  cp *.h output/include
	  cp *.a output/lib
	  make -C test

libindex_reader.a : index_reader.o
	$(AR) -crv $@ $^

%.o : %.cpp
	$(GCC) $(CPPFLAGS) $(HEAD_INFO) -c $< -o $@ $(INCLUDES)

clean :
	rm -rf *.o
	rm -rf *.a
	rm -rf output 
	make -C test clean
